<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<title>还款详情</title>
	    <meta name="apple-touch-fullscreen" content="yes" />
	    <meta name="apple-mobile-web-app-capable" content="yes" />
	    <meta content="black" name="apple-mobile-web-app-status-bar-style" /> 
	    <meta content="telephone=no" name="format-detection" /> 
	    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
	    <meta name="keywords" content="星融h5" />
	    <meta name="mobiletitle" content="还款详情页" />
			<script src="js/lib/jquery-1.11.1.min.js"></script>
		<script src="js/lib/rem.js"></script>
		<link rel="stylesheet" href="css/m-base.css" />
		<link rel="stylesheet" href="css/repaydetail.css" />	
	</head>
	<body>
		<div class="warpper">
			<div class="container">
				<div class="page-header clearfix">
						<a href="javascript:history.go(-1);" class="page-back"></a>
						<p class="page-title"><span class="status">还</span>款详情</p>
				</div>
				<div class="page-form">
					<div class="form-group clearfix">
						<p class="form-wz"><span class="should-time">-月-日</span><span class="should">应还</span></p>
						<p class="form-money">￥0</p>
						<div class="periods">
							<span class="product-name">---</span>
							<span class="periods02">第<span class="create">1期/共1期</span>
						</div>
					</div>	
				</div>
				<div class="kongxi"></div>
				<div class="form-bt">
					<p><span class="status">还</span>款明细</p>
				</div>
				<ul class="form-group2">
					
					<li class="form_li clearfix">
						<p class="form-bt2">申请金额</p>
						<p class="form-bt3 list-money">0.00</p>
					</li>
					<li class="form_li clearfix">
						<p class="form-bt2">放款时间</p>
						<p class="form-bt3 time">0000-00-00 00:00</p>
					</li>
					<li class="form_li clearfix">
						<p class="form-bt2"><span>还</span>款总金额</p>
						<a class="form-bt3 countmoney">0</a>
					</li>
				</ul>
			</div>
		</div>
		<script src="js/lib/utils.js"></script>
		<script src="js/lib/ajax.js"></script>
		<script>
			$(function(){
				var id = getQueryString("id");
				var status = getQueryString("status");
					var repay = {
							url:'/pay/show',
							data:{ 
									id: id,
									status: status
							},
							success: function(res){
									if(res.code == 1){
											var money = res.data.pay_money;
											var listmoney = res.data.apply_price;
											var time = res.data.loan_complete_time;
											switch(status){
													case "7":
														statushtml = "借";
														$(".should").html("已还");
														break;
													case "5":
														statushtml = "还";
														$(".should").html("应还");
														break;
													default:;
                  
											}
											$(".form-money,.countmoney").html(money);
											$(".list-money").html(listmoney);
											$(".time").html(time);
											$(".status").html(statushtml);
											$(".should-time").html(res.data.interest_date);
											$(".product-name").html(res.data.product_name);
									}
							}
					}
					sendRequest('post',repay);
					// 获取地址栏参数
					function getQueryString(name) {
							var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
							var r = window.location.search.substr(1).match(reg);
							if (r != null) {
											return unescape(r[2]);
							}
							return null;
					}
					// 时间戳转换
					function getDate(tm){ 
            var tt=new Date(parseInt(tm) * 1000).toLocaleString().replace(/年|月/g, "/").replace(/日/g, " ") 
            return tt; 
          }
			})
		</script>
	</body>
</html>
